<!-- HTML5 sekce pro diskuzi -->
      <section id="content">        
        <div class="block">
          <header>
            <?php if (Auth::instance()->logged_in() && $discussion->locked !== '1'): ?>
            <div class="top-right text-gray"><a class="href-gray" href="javascript:cite_reply('discussion-topic');" title="Odpovědět a tento příspěvek">citovat</a> &nbsp; <a class="href-gray" href="javascript:reply();" title="Odpovědět">odpovědět</a></div>
            <?php endif ?>
            <?php if ($discussion->locked == '1'): ?>
            <div class="top-right text-gray"><strong>Téma bylo uzamčeno.</strong></div>
            <?php endif ?>
            <h2><?php echo $discussion->username ?> - <?php echo $discussion->title ?></h2>
          </header>
          <section id="discussion-topic" class="block-body">
            <?php echo $discussion->text ?>
          </section>
        </div>
        <div class="block-bottom"></div>
        <?php foreach ($reply as $reply_item): ?>
        <div class="block">
          <header>
            <?php if (Auth::instance()->logged_in() && $discussion->locked !== '1'): ?>
            <div class="top-right"><a class="href-gray" href="javascript:cite_reply('discussion-thread-<?php echo $reply_item->id; ?>');" title="Odpovědět a citovat tento příspěvek">citovat</a></div>
            <?php endif ?>
            <h3><?php echo $reply_item->username ?> </h3>
          </header>
          <section id="discussion-thread-<?php echo $reply_item->id; ?>" class="block-body">
            <p><img class="icon" src="<?php echo url::base() ?>media/img/icons/mini_date.png" alt="" /> <?php echo Helpers_Photovoice::datum($reply_item->date); ?></p>
            <?php echo $reply_item->text ?>
          </section>
        </div>
        <div class="block-bottom"></div>
        <?php endforeach ?>
      </section>
      <?php if (Auth::instance()->logged_in() && $discussion->locked !== '1'): ?>
      <script>
        $(function() {
          $( "#dialog-confirm" ).hide();
        });
         function reply() {
            $( "#dialog-confirm" ).dialog({
              resizable: false,
              width: 500,
              modal: true,
              draggable: false,
              closeOnEscape: true
            });
          }
         function cite_reply(id) {
            $( "textarea.text-big" ).html('<cite>'+$('#'+id).html()+'</cite>\n\n');
            $( "#dialog-confirm" ).dialog({
              resizable: false,
              width: 500,
              modal: true,
              draggable: false,
              closeOnEscape: true
            });
          }
      </script>
      <div id="dialog-confirm" title="<?php echo $userAuth->username.' &rarr; '.$discussion->title ?>">
        <section class="dialog-comment">
        <form action="<?php echo url::base(); ?>comments/discussion_add" method="post">
          <ul>
            <li>
              <textarea cols="10" rows="10" name="text" class="text-big" ></textarea>
            </li>
            <li class="float-right"><input type="submit" class="submit" value="Odeslat"></li>
          </ul>
          <?php echo Form::hidden('did', $discussion->id); ?>
       </form>
       </section>
     </div>
     <?php endif ?>